<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
</html>
<script>
  const arr = [
    { name: "song", age: 18 },
    { name: "Y", age: 19 },
    { name: "son", age: 20 },
    { name: "so", age: 21 },
  ];
  const newArr = arr.filter((item, index, arr) => {
    return item.age > 19;
  });

  console.log(newArr); //[ { name: 'son', age: 20 }, { name: 'so', age: 21 } ]
  console.log(arr); //[ { name: 'song', age: 18 },{ name: 'Y', age: 19 },
  //{ name: 'son', age: 20 }, { name: 'so', age: 21 }]
</script>
